/*
 * =====================================================================================
 *
 *       Filename:  main.c
 *
 *    Description:  Command set using library "AvlTree".
 *
 *        Version:  0.1
 *        Created:  2017/02/14 17:10:38
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Brook L. (), Brook_L@163.com
 *   Organization:  
 *
 * =====================================================================================
 */

#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "../../AvlTree/avlTree.h"
#include "cmdSet.h"

int main(int argc, char *argv[]) {
    char *cmds[] = {
        "cmd1",
        "cmd2",
        "cmd3",
        "cmd3",
        "cmd2",
        "cmd1",
        "cmd4"
    };
    int i;

    cmdSetInit();
    printf("All commands:\n");
    avlTrav(&gCmdSet, gCmdSet.root);

    for (i = 0; i < sizeof(cmds) / sizeof(char *); i++) {
        cmdSetExe(cmds[i]);
    }

    return 0;
}
